# 可变对象: 变了对应的值可以修改, 但是内存地址不会发生变化
# 🏀 可变类型: list, dict, set
# 🏀 不可变类型: tuple, str, int, float, bool, None


# --------- list ---------
from os import name

print("-------------list----------------------")
li = [1, 2, 3, 4]
print(f"li的原内存地址:{id(li)}")  # li的原内存地址:4303470336
li.append(5)
print(f"li的新内存地址:{id(li)}")  # li的新内存地址:4303470336 - 不变

# --------- dict ---------
print("-------------dict----------------------")
di = {"name": "leslie", "age": 18}
print(f"di的原内存地址:{id(di)}")  # di的原内存地址:4365265216
di["name"] = "leslie_changed"
di["age"] = 19
print(f"new di is: {di}")
print(f"di的new内存地址:{id(di)}")  # di的new内存地址:4365265216

# --------- set ---------
print("-------------dict----------------------")
s1 = {1, 2, 3, 4}
print(f"s1 m address: {id(s1)}")  # 4375017952
s1.add(100)
print(f"new s1 is: {s1}")  # new s1 is: {1, 2, 3, 100, 4}
print(f"s1 m address: {id(s1)}")  # 4375017952
